import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'
import Home from '../views/Home.vue'
import Hotel from '../views/Hotel.vue'
import Login from '../views/Login.vue'
import AddHotel from '../views/AddHotel.vue'
import addTenant from '../views/addTenant.vue'
import Yuyu from '../views/Yuyu.vue'

Vue.use(VueRouter)

const routes: Array<RouteConfig> = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/yuyue/:hotels',
    name: 'Yuyu',
    component: Yuyu
  },
  {
    path: '/addtenant/:hotels',
    name: 'addTenant',
    component: addTenant
  },
  {
    path: '/hotel',
    name: 'Hotel',
    component: Hotel
  },
  {
    path: '/addhotel',
    name: 'AddHotel',
    component: AddHotel
  },
  {
    path: '/Login',
    name: 'Login',
    component: Login
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
